﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// Reviewed
#pragma once

#include "GcmpModelInterface.h"
#include "IElement.h"

namespace gcmp
{
    /// \brief 打洞关系对象
    /// 
    /// 打洞关系，即一个Element在另外一个Element几何体上开洞得到，如门、窗和墙的打洞关系
    FINAL_INTERFACE class GCMP_MODEL_INTERFACE_EXPORT IElementOpening : public IElement
    {
        DEFINE_CAST_DERIVED(gcmp::IElementOpening, gcmp::IElement);
    public:
        /// \brief 析构函数
        virtual ~IElementOpening() {};

        /// \brief 创建打洞关系对象
        /// \param pDocument 当前文档
        /// \param OpeningId 打洞对象的ElementId
        /// \param OpenedId 被打洞对象的ElementId
        /// \param isSetHostInstance 是否把OpenedId设置为OpeningId宿主， true--设置，false---不设置
        /// \return 打洞关系对象
        static IElementOpening* Create(IDocument* pDocument, const ElementId &OpeningId, const ElementId &OpenedId, bool isSetHostInstance=true);

        /// \brief 获取打洞对象的ElementId
        /// \return 打洞对象的ElementId
        virtual ElementId GetOpeningId() const = 0;

        /// \brief 获取被打洞对象的ElementId
        /// \return 被打洞对象的ElementId
        virtual ElementId GetOpenedId() const = 0;

        /// \brief 设置被打洞对象
        /// \param openedId 被打洞对象的ElementId
        /// \return 无
        virtual void SetOpenedId(const ElementId& openedId) = 0;

        /// \brief 设置打洞对象
        /// \param openingId 打洞对象的ElementId
        /// \return 无
        virtual void SetOpeningId(const ElementId& openingId) = 0;

    public:
        /// \brief 获取Implementation Uid
        ///
        /// \return UniIdentity 返回ImplementationUid
        static UniIdentity GetImplementationUid();
    };
}


